home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / util / gettagarray.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-05-12  |  671 b   |  46 lines

  1.  
  2. #include "tek/util.h"
  3.  
  4. /* 
  5. **    TEKlib
  6. **    (C) 2001 TEK neoscientists
  7. **    all rights reserved.
  8. **
  9. **    TUINT TGetTagArray(TTAGITEM *taglist, TTAG *tagarray)
  10. **
  11. **    get tag array
  12. **
  13. */
  14.  
  15. TUINT TGetTagArray(TTAGITEM *taglist, TTAG *tagarray)
  16. {
  17.     TUINT num = 0;
  18.     if (taglist)
  19.     {
  20.         TTAGITEM *temp;
  21.         while (*tagarray != TTAG_DONE)
  22.         {
  23.             temp = taglist;
  24.             while (temp->tag != TTAG_DONE)
  25.             {
  26.                 if (temp->tag == (TTAG) TTAG_MORE)
  27.                 {
  28.                     temp = (TTAGITEM *) temp->value;
  29.                 }
  30.                 else
  31.                 {
  32.                     if (temp->tag == *tagarray)
  33.                     {
  34.                         *((TTAG *) *(tagarray + 1)) = temp->value;
  35.                         num++;
  36.                         break;
  37.                     }
  38.                     temp++;
  39.                 }
  40.             }
  41.             tagarray += 2;
  42.         }
  43.     }
  44.     return num;
  45. }
  46.